package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.service.CountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/count")
public class CountController {

    @Autowired
    private CountService countService;

    //统计员工性别
    @GetMapping("/gender")
    public Result genderCount() {
        log.info("count");
        return Result.success(countService.genderCount());
    }

    //统计各类销售金额
    @GetMapping("/sales")
    public Result salesCount() {
        log.info("count");
        return Result.success(countService.salesCount());
    }

    //统计vip各等级人数
    @GetMapping("/vip")
    public Result vipCount() {
        log.info("count");
        return Result.success(countService.vipCount());
    }



}
